package com.example.maili.woxiamg.adapter.homeadapter;


import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.maili.woxiamg.R;
import com.example.maili.woxiamg.bean.HomeBean;
import com.example.maili.woxiamg.utils.AppUtils;

import java.util.List;


/**
 * Created by MAILI on 2017/10/11.
 */

public class ScriptRecyclerViewAdapter extends BaseQuickAdapter<HomeBean.ScriptListBean, BaseViewHolder> {

    private Context context;

    public ScriptRecyclerViewAdapter(@LayoutRes int layoutResId, @Nullable List<HomeBean.ScriptListBean> data, Context context) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeBean.ScriptListBean item) {
        helper.setText(R.id.tv_gridview, item.getScriptName());
        AppUtils.displayImageGlide(context, (ImageView) helper.getView(R.id.img_gridview), item.getImage());
    }
}
